using Source.Common;

namespace Source.ServiceLayer
{
    public class ConfigurationProvider : IConfigurationProvider
    {
        private readonly OlaConfiguration configSection;

        public ConfigurationProvider()
        {
            configSection = OlaConfiguration.LoadConfiguration();
        }

        public int MaxAttachmentSizeInBytes
        {
            get { return configSection.MaxAttachmentSizeInBytes; }
        }

        public int MaxTotalAttachmentSizePerOrderInBytes
        {
            get { return configSection.MaxTotalAttachmentSizePerOrderInBytes; }
        }

        public int MaxNumberAttachmentPerOrder
        {
            get { return configSection.MaxNumberAttachmentPerOrder; }
        }

        public double ExchangeRateCacheTTLInHours
        {
            get { return configSection.ExchangeRateCacheTTLInHours; }
        }
        public int SessionTokenCacheTTLInMinutes
        {
            get { return configSection.SessionTokenCacheTTLInMinutes; }
        }

        public string FromEmailAddress
        {
            get { return configSection.FromEmailAddress; }
        }

        public string OpenOrderLink
        {
            get { return configSection.OpenOrderLink; }
        }

        public string EmailTemplateDirectory
        {
            get { return configSection.EmailTemplateDirectory; }
        }

        public string SmtpHost
        {
            get { return configSection.SmtpHost; }
        }

        public string SmtpUserName
        {
            get { return configSection.SmtpUserName; }
        }

        public string SmtpPassword
        {
            get { return configSection.SmtpPassword; }
        }

        public string SmtpDomain
        {
            get { return configSection.SmtpDomain; }
        }

        public string DevelopmentEmailAddress
        {
            get { return configSection.DevelopmentEmailAddress; }
        }

        public string GemBoxLicense
        {
            get { return configSection.GemBoxLicense; }
        }

        public int ExportMaxOrders
        {
            get { return configSection.ExportMaxOrders; }
        }

        public string ConnectionString
        {
            get
            {
                return string.Format(configSection.EntityFrameworkConnectionString, configSection.ConnectionString);
            }
        }
    }
}